package ace.module.oauth2.server.core.impl.dao.repository;


import ace.cmp.spring.data.jdbc.querydsl.core.repository.QuerydslJdbcBaseRepository;
import ace.module.oauth2.server.core.impl.constant.Oauth2ServerCoreConstants;
import ace.module.oauth2.server.core.impl.dao.entity.Oauth2Authorization;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springframework.stereotype.Repository;

/**
 * 客户端认证的令牌 repository.
 *
 * @author Caspar
 */
@DS(Oauth2ServerCoreConstants.DEFAULT_DATA_SOURCE_NAME)
@Repository
public interface Oauth2AuthorizationRepository
    extends QuerydslJdbcBaseRepository<Oauth2Authorization,String> {

  Oauth2Authorization getByRefreshTokenValue(String refreshTokenValue);

  Oauth2Authorization getByAccessTokenValue(String accessTokenValue);

  Oauth2Authorization getByAuthorizationCodeValue(String authorizationCodeValue);

  Oauth2Authorization getByState(String state);
}
